home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 07 - 1991 / 07.07 Jul 91 / MacLock 1.0 / CMacLockDoc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-03-27  |  1.8 KB  |  82 lines  |  [TEXT/KAHL]

  1. /*****
  2.  * FILE:        CMacLockDoc.c
  3.  * Programmer:    Mark Bykerk Kauffman
  4.  * Date:        1/91
  5.  * Purpose:
  6.  *        Document methods for MacLock.
  7.  * PARENTCLASS = CStarterDoc    
  8.  *
  9.  *****/
  10.  
  11. #include <Global.h>
  12. #include <Commands.h>
  13. #include <CDesktop.h>
  14. #include <CScrollPane.h>
  15. #include "CMacLockPane.h"  
  16. #include "CMacLockDoc.h"
  17.  
  18. /* Global Variables for objects of this class.    */
  19. extern    CDesktop    *gDesktop;        
  20.  
  21. /* Class Constants */
  22. #define    WINDMacLock        500        /* Resource ID for the MacLock window.     */
  23.  
  24. /* METHOD IMPLEMENTATIONS */
  25.  
  26. /*****
  27.  * IMacLockDoc
  28.  *
  29.  *    MacLockDoc's initialization method.
  30.  *
  31.  *****/
  32.  
  33. void CMacLockDoc::IMacLockDoc(CBureaucrat *aSupervisor, Boolean printable)
  34.  
  35. {
  36.     CDocument::IDocument(aSupervisor, printable);
  37. }
  38.  
  39.  
  40. /*****
  41.  * BuildWindow
  42.  *
  43.  *  The NewFile() and OpenFile() in the MacLockDoc's parent class use
  44.  *  this method to create a window.  Because MacLock doesn't do anything
  45.  *  with files, NewFile and OpenFile methods do not need to be defined
  46.  *  for MacLock.  MacLock's window is unique to MacLock so BuildWindow
  47.  *  does need to be defined.
  48.  *
  49.  *****/
  50.  
  51. void CMacLockDoc::BuildWindow (Handle theData)
  52.  
  53. {
  54.     CScrollPane        *theScrollPane;
  55.     CMacLockPane    *theMainPane;
  56.  
  57.     itsWindow = new(CWindow);
  58.     itsWindow->IWindow(WINDMacLock, FALSE, gDesktop, this);
  59.  
  60.     theScrollPane = new(CScrollPane);
  61.     
  62.     /* Initialize theScrollPane without scroll bars or size box.
  63.     */
  64.     theScrollPane->IScrollPane(itsWindow, this, 10, 10, 0, 0,
  65.                                 sizELASTIC, sizELASTIC,
  66.                                 FALSE, FALSE, FALSE);
  67.  
  68.     theScrollPane->FitToEnclFrame(TRUE, TRUE);
  69.  
  70.     theMainPane = new(CMacLockPane);
  71.     itsMainPane = theMainPane;
  72.     itsGopher = theMainPane;
  73.  
  74.     theMainPane->IMacLockPane(theScrollPane, this, 0, 0, 0, 0, sizELASTIC, sizELASTIC);
  75.     theMainPane->FitToEnclosure(TRUE, TRUE);
  76.  
  77.     theScrollPane->InstallPanorama(theMainPane);
  78.     
  79. }
  80.  
  81.  
  82.